package cn.cdut.yiwenqian.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * CdutPostTitletypes entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CDUT_POST_TITLETYPES", catalog = "cdutpostbar")
public class CdutPostTitletypes implements java.io.Serializable {

	// Fields

	private Integer unumber;
	private String parentnumber;
	private String name;
	private String intro;
	private Set<CdutPostTitles> cdutPostTitleses = new HashSet<CdutPostTitles>(
			0);

	// Constructors

	/** default constructor */
	public CdutPostTitletypes() {
	}

	/** minimal constructor */
	public CdutPostTitletypes(Integer unumber) {
		this.unumber = unumber;
	}

	/** full constructor */
	public CdutPostTitletypes(Integer unumber, String parentnumber,
			String name, String intro, Set<CdutPostTitles> cdutPostTitleses) {
		this.unumber = unumber;
		this.parentnumber = parentnumber;
		this.name = name;
		this.intro = intro;
		this.cdutPostTitleses = cdutPostTitleses;
	}

	// Property accessors
	@Id
	@GeneratedValue(generator="titleTypeIdGenerator")
	@GenericGenerator(name="titleTypeIdGenerator",strategy="increment")
	@Column(name = "unumber", unique = true, nullable = false)
	public Integer getUnumber() {
		return this.unumber;
	}

	public void setUnumber(Integer unumber) {
		this.unumber = unumber;
	}

	@Column(name = "parentnumber", length = 12)
	public String getParentnumber() {
		return this.parentnumber;
	}

	public void setParentnumber(String parentnumber) {
		this.parentnumber = parentnumber;
	}

	@Column(name = "name", length = 32)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "intro", length = 128)
	public String getIntro() {
		return this.intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostTitletypes")
	public Set<CdutPostTitles> getCdutPostTitleses() {
		return this.cdutPostTitleses;
	}

	public void setCdutPostTitleses(Set<CdutPostTitles> cdutPostTitleses) {
		this.cdutPostTitleses = cdutPostTitleses;
	}

}